package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	//1.
	//var myChars [26]byte
	//for i := 0; i < 26; i++ {
	//	myChars[i] = 'A' + byte(i)
	//
	//}
	//for i := 0; i < 26; i++ {
	//	fmt.Printf("%c ", myChars[i])
	//}
	//2.
	//var intArr = [...]int{1, -1, 9, 90, 12}
	//maxval := intArr[0]
	//maxValIndex := 0
	//for i := 0; i < 5; i++ {
	//	if maxval < intArr[i] {
	//		maxval = intArr[i]
	//		maxValIndex = i
	//	}
	//}
	//sum := 0
	//for _, value := range intArr {
	//	sum += value
	//}
	//fmt.Printf("和为%v,平均值为%v\n", sum, float64(sum)/float64(len(intArr)))
	//fmt.Printf("maxVal=%v,maxValIndex=%v", maxval, maxValIndex)
	//3.
	var intArr3 [5]int
	rand.Seed(time.Now().UnixNano())
	for i := 0; i < len(intArr3); i++ {
		intArr3[i] = rand.Intn(100) //0<=n<100

	}
	fmt.Println(intArr3)
	temp := 0
	for i := 0; i < len(intArr3)/2; i++ {
		temp = intArr3[len(intArr3)-1-i]
		intArr3[len(intArr3)-1-i] = intArr3[i]
		intArr3[i] = temp
	}
	fmt.Println(intArr3)

}
